
abstract class ListItem{}

class HeadingItem implements ListItem{
  final String heading;

  HeadingItem(this.heading);
}

class MessageItem implements ListItem{
  final String sender;
  final String body;

  MessageItem(this.sender, this.body);
}

class Todo{
  final String title;
  final String description;

  Todo(this.title, this.description);
}

class JsonPost{
  final int userId;
  final int id;
  final String title;
  final String body;

  JsonPost(this.userId, this.id, this.title, this.body);

  factory JsonPost.fromJson(Map<String, dynamic> json){
    return new JsonPost(json['userId'], json['id'], json['title'], json['body']);
  }
}

